Contents

Tape List Box	Main Dialog Box listing all tapes

Volume List Box	Volume Dialog Box listing all volumes on tape

Procedures	Procedures and Routines used in program

Data Structures	Data Structures used and Limits

About Program	About the Program


Tape_List_Box

Tape List Box

The  'Tape List Box"  is a listing of the tapes currently in the memory,  this listing may added to or reduced by the merge and delete commands.

Mouse Commands :

Single Click a Tape	Single click a tape listing selects that tape.

Double Click a Tape	Double click a tape listing activates the Volume display.

Main Menu Commands :

Files	Open	Tape Data File	Open Tape Data File

ASCII Data File	Open ASCII Data File

Merge	Tape Data File	Merge Tape Data File

ASCII Data File	Merge ASCII Data File

Write / Save	Save Tape Data File

Save as	Tape Data File	Save As Tape Data File

ASCII Data File	Save As Tape Data File

Exit	Exit the Program

Erase Tape	Erase a Tape Listing

Search Tape	Search all tapes for a matching file

Save Note	Save the Edited Note

Move Up	Move tape listing up a rung

Move Dn	Move tape listing down a rung

Exit Prog	Exit the Program

Help / Info	Help - Index	Help - Index

Data Information	Help - Memory and System

About Program	About the Program

Main Button Commands :

Str Search	Search all tapes for a matching file

Erase Tape	Delete a Tape Listing

Save Note	Save the Edited Note

Move Up	Move tape listing up a rung

Move Dn	Move tape listing down a rung

Select Tape	Select a tape

Exit Program	Exit the Program


Single Click a Tape
Single Click a Tape Listing

To  "Single Click a Tape Listing"  will select that tape listing,  the note attached to the listing is displayed at the bottom.


Double Click a Tape
Double Click a Tape Listing

To  "Double Click a Tape Listing"  will select that tape listing and bring up a  'Volume Listing'  that tape.


Files

A file is referred to either as a  "Tape File"  with a "Tp" extension,  or an  "ASCII File"  with a  "Lst or Txt"  extension.


Tape Data Files
Tape File

The  "Tape File"  with a  "Tp"  extension is a data base formed file with the following format and structure :

WORD  Value noting the number of  "Tape_Info"  data blocks that follow

struct Tape_Info {

char	Tape_Label[19],	// Label on the tape

Tape_Notes[81];	// Notes about the tape

DWORD	Total_Size;	// Sum of all Volumes

WORD	Volume_Count;	// Number of Volume Blocks that follow

struct Volume_Info {

WORD	Volume_ID;	// Volume ID Number

char	Volume_Title[48],	// Volume Title

Volume_Date[11],	// Volume Date

Volume_Time[9],	// Volume Time

Volume_Version[13];	// Volume Version

DWORD	Volume_Size;	// Size of the Volume

WORD	Dir_File_Count;	// Number of Directories and Files Blocks that follow

struct Dir_File_Info {

DWORD	File_Size,	// Size of file in bytes

// 28   23    17    13   7      2  1 0

Date_Time_Flag;	// MMMM DDDDD YYYYY HHHH MMMMMM LL A D

// Month Day Year Hour Minute Level AM Dir

// 0-15, 0-31, 0-61, 0-15, 0-61, 0-31, 1, 1

Name[2];	// Name of File or Directory in 6 bits

BYTE	Name_Byte;	// Name of File or Directory in 6 bits

6 bits / character to compress the file description are as follows :

       Name[0]                           Name[1]                           Name_Byte

DWORD  33222222222211111111110000000000  33222222222211111111110000000000  00000000

       10987654321098765432109876543210  10987654321098765432109876543210  76543210

Name   00000000000000000000000000000011  00000000000000000000000011111111  11111111

       11111122222233333344444455555522  66666677777788888899999900000022  22111111


ASCII Data File

The  "ASCII Data File"  with either a  "Lst"  or  "Txt"  extension is a data base formed file with the following format structure :

A.	First Line,  blank or with information

B.	Second Line,  must have the form style  "TAPEDUMP VERSION"  currently the only type presently able to convert.

C.	Heading information and etc.

D.	Will read until the string  "Volume label: "  is found with the following two lines.   The information must be position as follows :

00000000001111111111222222222233333333334444444444555555555566666666667777777777

01234567890123456789012345678901234567890123456789012345678901234567890123456789

Volume #  1    Volume label: DOS:STACVOL_DSK   Volume size: 8,536,905

Created on 07-25-1993 at 03:20 PM   Ver: 2.49-2.8

Volume title: MathCad, Ver 3.10, 111092-0117719-MC

E.	The volume files must follow without a blank line,  again the positions must be held for the program to convert the information.   Note that each file / directory level is 4 characters in,  and a directory does not have a size :

00000000001111111111222222222233333333334444444444555555555566666666667777777777

01234567890123456789012345678901234567890123456789012345678901234567890123456789

\

    MATHCAD                                 07-25-1993  02:00 PM

        PROGRAM1                            07-25-1993  02:00 PM

            DIR0.ZIP                        03-20-1992  04:49 PM     850,573

            DIR1.ZIP                        03-20-1992  04:49 PM       4,979

            DIR2.ZIP                        03-20-1992  04:49 PM     266,499

            DIR3.Z00                        03-20-1992  04:49 PM     125,952

F.	Blank line notes the start of a new volume on the tape,  end of file will close the routine.


Open Functions
Open File

To "Open" a file,  either a  "Tape File"  with a "Tp" extension,  or an  "ASCII File"  with a  "Lst or Txt"  extension.   The  "Open"  command will erase all previously stored data and changes made in memory.   Then open a Windows dialog to select a file.


Merge Function
Merge

To "Merge" a file,  either a  "Tape File"  with a "Tp" extension,  or an  "ASCII File"  with a  "Lst or Txt"  extension.   The  "Merge"  command will let you add to all the previously stored data and changes made in memory.   This opens a Windows dialog to select a file.


Write Save Function
Write / Save

To Save a  "Tape File"  with a "Tp" extension.   The  "Save"  command will let you save the current memory information to disk with modifications.   This command saves / rewrites the last opened data file,  if no data file had been opened previously then it will use a windows dialog box to select a new or current file name.


Save as Function
Save as

To "Save" as a file,  either a  "Tape File"  with a "Tp" extension,  or an  "ASCII File"  with a  "Lst or Txt"  extension.   The  "Save as"  command will let you save all the previously stored data and changes made in memory to a file.   This opens a Windows dialog to select a new or current file name.


Delete Function
Delete

To Delete a tape reference from the data base,  first select the tape title then press  "Delete"  from either the menu or by using the buttons.  A warning sign / box will have to be  "OK'd"  before the selected tape information is removed from memory.   Note that the file still has to be  "Save"  to change the disk data


Select a Tape

To  "Select a Tape"  will bring up a  'Volume Listing'  of a tape that was selected.


Move Up a Tape Rung
Move Up

To  "Move Up"  will move a selected tape listing one rung higher in the listing.


Move Down a Tape Rung
Move Down

To  "Move Down"  will move a selected tape listing one rung down in the listing.


Exit

To Exit press either the  "Exit Program"  button,  or select the  "Exit" in the menu.   This command will restore all memory reserved for the data base,  (Sys Close has the same effect).


Search Function
Search

The  "Search"  function will search either for a string or a date reference,  if selected in the  "Tape List"  dialog then all tapes in the current memory will be searched for match.   If "Search" is selected from the  "Volume List"  then only that tape is searched for a match.

The  "String"  search looks for a match in both directories and file names when a string is present.

The  "Date"  search when selected,  will compare only file dates with regard to the
selected function :	Before	A file date that is below the stated date;

Match	A file date that is the same as the stated date.

After	A file date that is greater then the stated date

Note - The maximum search is limited to 8,000 lines of information,  for every item found the previous directory(s) count as a line of information each.


Help Function
Help

The  "Help"  menu function is broken down to four sub functions as follows

Help	Index	The complete index or contents of the help file

Data Information	Memory usage and size information

About Program	Information about the program


Help - Index

The  "Help - Index"  is the contents of the program


Data Information

The  "Data Information"  is a memory usage report routine :

This reports the type of memory block,  number in use,  maximum number,  and bytes used for the block of memory.

Tape Array	Information on the tape listing with notes and size

Volume Array	Information about the volumes listed with each tape,  max. set to 256 per tape listing.

Dir / File Array	Information about every file and directory in the volume,  limited to  3850  per volume.   Limited by system memory.

Search Array	Information about results from a search,  limited to  8000 items including the tape and directories.

Total Memory in System  Vs  the amount of memory used by this program in both a value and percentage of system memory.

Tape Array  --\----Volume Array  -\------Dir/File Array	(3850 per Volume)

(256 Max.) 	|	(256 per Tape)	|-----Dir/File Array

|	|-----Dir/File Array

|	\-----Dir/File Array

|----Volume Array  -\------Dir/File Array	(3850 per Volume)

|	|-----Dir/File Array

|	|-----Dir/File Array

|	\-----Dir/File Array

\----Volume Array  -\------Dir/File Array	(3850 per Volume)

|-----Dir/File Array

|-----Dir/File Array

\-----Dir/File Array


Apout Program
About Program

GB Engineering

93 Taggart Way

Saddle Brook,  NJ  07663-4435

CompuServe  72466,1210

This program is free for your use,  feel free to pass it on

If you feel guilty send me $ 3.00 and I'll send the latest version

The complete source code in C++  "Borland'  is available for  $ 15.00

$ 75.00 if you have a different ASCII Dump format and wish a modification to the program

If you find an error please drop me a message.


Save Edited Note

Each "Tape Listing"  comes with a 80 character personal label,  once a tape is selected in the list box the current note for this listing is displayed.   You can change it,  or add one,  then "Save" the data file back to disk.


Volume List Box

The  'Volume List Box"  is a listing of the volumes on a selected tape currently in the memory.

Mouse Commands :

Single Click a Volume	Single click a volume listing selects that volume.

Double Click a Volume	Double click a volume listing activates the Dir / File display.

Main Button Commands :

Search for File	Search volume for a matching file

View Select Volume	View a Select volume

Clear all Listing	Clear all Dir / File displays

Exit Volume Listing	Return to Tape listing dialog box


Single Click a Volume
Single Click a Volume Listing

To  "Single Click a Volume Listing"  will select that volume listing.


Double Click a Volume
Double Click a Volume Listing

To  "Double Click a Volume Listing"  will select that volume listing and display the Directories and Files listed in the volume.


View a Volume
View Select Volume

To  "View Select Volume"  will bring up a  'Directory / File Listing'  of the volume that was selected.


Clear all Dir/File Listings
Clear all Listings

To  "Clear all Listing"  will remove all  'Directory / File Listing'  currently on the screen.


Exit Volume Dialog
Exit Volume Listing

To Exit Volume Dialog press the  "Exit Volume Listing"  button.   This command will restore the  'Tape Listing Box'  with the current volume selected


Search Volume
Search

The  "Search"  function will search either for a string or a date reference,  if selected in the  "Tape List"  dialog then all tapes in the current memory will be searched for match.   If "Search" is selected from the  "Volume List"  then only that tape is searched for a match.

The  "String"  search looks for a match in both directories and file names when a string is present.

The  "Date"  search when selected,  will compare only file dates with regard to the
selected function :	Before	A file date that is below the stated date;

Match	A file date that is the same as the stated date.

After	A file date that is greater then the stated date

Note - The maximum search is limited to 8,000 lines of information,  for every item found the previous directory(s) count as a line of information each.


Procedures used in program
Procedures

Complete listing of all Procedures and Routines :

Files.Cpp

Get a file name dialog

LONG Get_File (	HWND hWnd,	// Window Handle

HANDLE hInst,	// Resource Instance

int Type,	// Type of file to open

char *sz_File,	// File Name

int Name_Lg,	// Length of String

char *sz_File_Str,	// File Name and Path

int Name_Str_Lg,	// Length of String

int Keep_Name,	// Flag to note keeping name

int Function);	// What function to perform

Save tape data from memory to disk

void Save_Tape_File (HWND hWnd, int New_File);

Read tape data file from the disk

void Read_Tape_File (HWND hWnd, int Function);

Dialog.Cpp

Main program and dialog routines

LRESULT CALLBACK _export WndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

General counting dialog routine, calls reads and writes from here

BOOL CALLBACK _export General_Dlg_Proc (HWND hDlg, WORD message, WORD wParam, LONG lParam);

Routines.Cpp

Message box,  loads from resource string and returns results.

int Message_Box (int ID_Str, char *c_A, char *c_B, char *c_C, char *c_Title, int Style);

Reads one ASCII line in from file,  ending with CrLf,  returns length.

int Read_File_Line (char *Line, int Length_of, FILE *Data);

Writes a ASCII line to a file ending with a CrLf,  returns length.

int Write_File_Line (char *Str, FILE *File);

Loads a window caption from the resource with a following string.

void Load_Window_Caption (HWND hWnd, int Caption, char *sz_File_Name);

Removes  'Spaces'  at the beginning and end of a string,  returns length.

int Remove_White_Space (char *Str);

Removes commas from a string number,  returns length.

int Remove_Commas (char *Str);

Adds commas into a string number.

int Add_the_Commas (char *Str);

Replaces non-ASCII char with  'Spaces' at beginning of line,  returns count to first char.

int Make_White_Space (char *Str);

Compresses a Directory or File information into a memory information block.

void Dir_File_Record_to_Dir_File_Info (Dir_File_Record *File_Rec, Dir_File_Info *File_Inf);

Decompresses a Directory or File memory information block to a ASCII record.

void Dir_File_Info_to_Dir_File_Record (Dir_File_Info *File_Inf, Dir_File_Record *File_Rec);

Forms an ASCII date string MM/DD/YY from a date information record.

char * To_Day(Date_Info *Date_Rec, int Style);

Checks and adjusts a modified date information record.

char * Check_Date (Date_Info *Date_Rec, int Style);

ASCII.Cpp

Writes an ASCII file of the Search Results

void Write_ASCII_Search (HWND hWnd);

Writes an ASCII file of a selected tape in the Tape List Box

void Write_ASCII_Tape_Dump (HWND hWnd, int Tape_ID);

Reads an ASCII dump from the TapeDump.Exe file

void Read_ASCII_Tape_Dump (HWND hWnd);

Memory.Cpp

Create or Expand a Tape array [Size]

void Expand_Tape_Array (HWND hWnd, int Size);

Create or Expand a Volume array [Size]

void Expand_Volume_Array (HWND hWnd, Volume_Info ** Ptr, int Size);

Create a Directory / File array [Size]

void Create_Dir_File_Array (HWND hWnd, Dir_File_Info ** Ptr, int Size);

Release and Erase memory for one tape listing.

void Release_Tape_Info (HWND hWnd, int Tape_ID);

Releases and Erases all memory used.

void Release_All_Tape_Info (HWND hWnd);

Creates a string memory block on the heap of (Size) characters

void Create_String_Memory (HWND hWnd, char ** Ptr, WORD Size);

Volume.Cpp

Creates a Volume List Dialog Box form a Tape Listing.

BOOL CALLBACK _export Volume_List_Dlg_Proc (HWND hDlg, WORD message, WORD wParam, LONG lParam);

Dir_File.Cpp

Displays a scrollable windows of Dir's and Files for a selected Volume (16 Max.)

LRESULT CALLBACK _export Dir_File_List_Dlg_Proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

Search.Cpp

Displays a scrollable windows of Dir's and Files for a tape or volume search

LRESULT CALLBACK _export Search_List_Dlg_Proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

Search routine,  for both Tape and Volumes.

void Search_Memory_for_Match (HWND hDlg);

Search Dialog Selection routine

BOOL CALLBACK _export Search_Dlg_Proc (HWND hDlg, WORD message, WORD wParam, LONG lParam);


Data Structures used in program
Data Structures

Limits of the Program :

MAX_TAPE	256	// Max. number of Tapes stored

MAX_VOLUME	256	// Max. number of Volume in each tape

MAX_DIR_FILE	3850	// Max. number of Dir / Files in each Volume

MAX_DF_DISPLAY	16	// Max. number of display windows

WINDOW_STEP	22	// Number of Pixels to offset each display

MAX_SEARCH_REC	8000	// Max. number of search items

Complete listing of all Data Structures :

Structure for "Program Flags"	2 bytes

struct Program_Flags {

unsigned	Tape_File :	1;

unsigned	Info_File :	1;

unsigned	ASCII_File :	1;

unsigned	A :	1;

unsigned	B :	1;

unsigned	C :	1;

unsigned	D :	1;

unsigned	E :	1;

unsigned	F :	1;

unsigned	G :	1;

unsigned	H :	1;

unsigned	Temp_Change_Flag :	1;

unsigned	Tape_Data_Changed :	1;

unsigned	Include_Volume :	1;

unsigned	Search_Active :	1;

unsigned	Dir_File_Active :	1; };

Structure for "Directory or File Array"	17 bytes

struct Dir_File_Info {

DWORD	File_Size,	// Size of file in bytes

Date_Time_Flag,	/* XXXX  XXXXX XXXXXX  XXXX XXXXXX XXXXX X  X

   Month Day   Year    Hour Minute Level AM Dir

   0-15  0-31  0-127   0-15 0-61   0-31  1  1   */

Name[2];	// Name of File or Directory in 6 bits

BYTE	Name_Byte; };	// Name of File or Directory in 6 bits

Structure for "Directory"	24 bytes

struct Dir_File_Record {

DWORD	File_Size;	// Size of file in bytes

BYTE	Month,

Day,

Year,

Hour,

Minute,

Level,

Time_AM,

Directory;

char	Name[12]; };	// Name of File or Directory in nibbles

Structure for "Volume Array"	93 Bytes

struct Volume_Info {

WORD	Volume_ID;	// Volume ID Number

char	Volume_Title[48],	// Volume Title

Volume_Date[11],	// Volume Date

Volume_Time[9],	// Volume Time

Volume_Version[13];	// Volume Version

DWORD	Volume_Size;	// Size of the Volume

WORD	Dir_File_Count;	// Number of Directories and Files

Dir_File_Info	*Dir_File_Ptr; };	// Pointer to a Dir / File Array

Structure for File "Volume Array"	87 Bytes

struct Volume_Info_File {

char	Volume_Title[48],	// Volume Title

Volume_Date[11],	// Volume Date

Volume_Time[9],	// Volume Time

Volume_Version[13];	// Volume Version

DWORD	Volume_Size;	// Size of the Volume

WORD	Dir_File_Count; };	// Number of Directories and Files

Structure for "Tape Array"	118 bytes

struct Tape_Info {

char	Tape_Label[19],	// Label on the tape

Tape_Notes[81];	// Notes about the tape

DWORD	Total_Size,	// Sum of all Volumes

Available,	// Available bytes on tape

Used;	// Used bytes on tape

WORD	Volume_Count;	// Number of Volumes

Volume_Info	*Volume_Ptr; };	// Pointer to a Volume Array

Structure for File "Tape Array"	114 bytes

struct Tape_Info_File {

char	Tape_Label[19],	// Label on the tape

Tape_Notes[81];	// Notes about the tape

DWORD	Total_Size,	// Sum of all Volumes

Available,	// Available bytes on tape

Used;	// Used bytes on tape

WORD	Volume_Count; };	// Number of Volumes

Structure for "Dir / File Display" 18 bytes

struct Dir_File_Display_Array {

int	Tape_ID,	// ID of the Tape

Count,	// Display, Dir File Number

Screen_Rows,	// Display, Number of rows on screen

Pointer,	// Display, Last point in data

Max_Level,	// Display, Max. display level

Display_Level;	// Display, Current display level

Volume_Info	*V_Ptr; 	// Pointer to a Volume Array

HWND	h_Dir_File; };	// Handle to Dir-File Display Window

Structure for "Dir / File Display" 38 bytes

struct Date_Info {

int	Year;	// The year 19XX...

BYTE	Day,	// The day in the month 1..31

Month;	// The Month of the year 1..12

unsigned	Search_String :	1;	// Search by String too

unsigned	Search_Date :	1;	// Search by date too

unsigned	Before :	1;	// Search for before given date

unsigned	Match :	1;	// Search for a matching date

unsigned	After :	1;	// Search for after given date

unsigned	Search_All :	1;	// Search for in all tapes

unsigned	Search_Tape :	1;	// Search for in Tape

unsigned	Search_Dir :	1;	// Search for Directory

char	sz_Search[12],	// Search String

Date_Str[11]; };	// Date string

Structure for "Search Results" 8 bytes

struct Search_Results {

WORD	Tape_ID,	// Tape found on

Volume_ID;	// Volume found in

Dir_File_Info	*DF_Ptr; };	// Pointer to information